package com.cmsz.collection.controller;

import com.cmsz.collection.service.KafkaListenerPushInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RequestMapping("/info")
@RestController
public class InfoController {


    private static Logger logger = LoggerFactory.getLogger(InfoController.class);

    @RequestMapping(value = "/pushInfo",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public String pushInfo(@RequestBody Map<String,List> map){
        try {
            logger.info("接收到请求参数:" + map);
            KafkaListenerPushInfoService.setPushMap(map);
        }catch (Exception e){
            logger.error(e.getMessage());
        }
        return "SUCCESS";
    }


}
